package main

import (
	"fmt"
	"math/rand"
	"net/http"
	_ "net/http/pprof"
)

func heavyWork() {
	for i := 0; i < 1e6; i++ {
		rand.Intn(1000)
	}
}

func handler(w http.ResponseWriter, r *http.Request) {
	heavyWork()
	fmt.Fprintf(w, "Hello World")
}

func main() {
	go func() {
		http.ListenAndServe(":6060", nil)
	}()

	http.HandleFunc("/", handler)
	http.ListenAndServe(":8080", nil)
}
